<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="format-detection" content="telephone=no" />
    <title>充值</title>
    <link rel="stylesheet" href="../../css/reset.css">
    <link rel="stylesheet" href="../../css/littmoneyrecharge.css">
    <style>
        .ishide {
            display: none;
        }

        .needShow {
            display: block;
        }

        .checkSt {
            float: right !important;
        }

        .ios-select-widget-box.olay {
            top: 2.2rem;
        }

        .ios-select-widget-box.olay>div {
            top: 2.2rem;
        }
    </style>
</head>

<body>
    <header>
        <ul class="payWays">
            <li class="isSelected moneyLi" data-type="blanceMoneyPay">
                余额充值
            </li>
            <li data-type="addressUsdt" class="usdtLi">
                USDT充值
            </li>
            <li data-type="addressFil" class="filLi">
                FIL充值
            </li>
        </ul>
    </header>
    <div class="bigBox">
        <div class="outBox">
            <div id="recharge" class="pageClass">
                <div class="recharge">
                    <div class="balance">
                        <div>
                            <p id="testID"
                                style="width: calc(100% - 0.24rem);height: 1rem;display:flex;display:-webkit-flex;justify-content: space-between;align-items: center;padding-right: 0.2rem;box-sizing: border-box;border-bottom: 1px solid #e2e2e2;">
                                <span style="display: flex;display: -webkit-flex;justify-content: flex-start;">
                                    选择币种
                                </span>
                                <span class="chooseReType"
                                    style="position:relative;display: flex;display: -webkit-flex;flex: 1;">
                                    <input type="hidden" name="bank_id" id="bankId" value="">
                                    <span id="showBank"
                                        style="width: 100%;height: 0.7rem;display: flex;display: -webkit-flex;justify-content: flex-end;align-items: center;">CNY</span>
                                </span>
                            </p>
                        </div>
                        <div style="padding-right: 0.24rem;">
                            <p>
                                <span>
                                    可用余额
                                </span>
                                <span>
                                    <span class="myproty">￥0.00 </span>
                                </span>
                            </p>
                        </div>
                        <div>
                            <p style="padding-right:0.24rem;">
                                <span> 充值金额</span>
                                <input type="number" min="1" class="addMoneyInput" placeholder="请输入你的充值金额,限整数"
                                    oninput="this.value=this.value=parseInt(Number(this.value))"
                                    onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'0')}else{this.value=this.value.replace(/\D/g,'')}"
                                    id="inputReNumber">
                                <span class="moneyUnit">
                                    元
                                </span>
                            </p>
                        </div>
                        <div class="showOtcInput" style="display: none;">
                            <p style="padding-right:0.24rem;">
                                <span> 卡主姓名</span>
                                <input type="text" class="addUsdtInputnew" placeholder="请输入转账卡主/支付宝认证姓名"
                                    id="cardCnyUserName">
                                <span class="moneyUnitx">
                                </span>
                            </p>
                        </div>
                    </div>
                </div>

                <div class="choosePayMethod">
                    <p class="w_t">
                        支付方式
                    </p>
                    <ul class="showchoose" style="display: none;">
                        <li class="wxPayMethod needShow">
                            <label for="wx_pay" data-method="WX_AMY">
                                <img src="../../image/weixin.png" alt="" class="labelTImg">
                                <span class="payTitle">微信支付</span>
                                <input id="wx_pay" class="chat-button-location-radio-input" value="WX_APP" type="radio"
                                    name="payWay" checked />
                                <span class="checkSt"></span>
                            </label>
                        </li>
                        <li class="publicPayMethod needShow">
                            <label for="public_pay" data-method="BANK_TRANSFER">
                                <img src="../../image/duigonga.png" alt="" class="labelTImg">
                                <span class="payTitle">对公转账(安全可靠不限额，推荐)</span>
                                <input id="public_pay" class="chat-button-location-radio-input" value="BANK_TRANSFER"
                                    type="radio" name="payWay" />
                                <span class="checkSt" style='float:right'></span>
                            </label>
                        </li>
                        <li class="cardPayMethod needShow">
                            <label for="card_pay" data-method="YSF_APP">
                                <img src="../../image/yinlian.png" alt="" class="labelTImg">
                                <span class="payTitle">银联支付(单笔限5000)</span>
                                <input id="card_pay" class="chat-button-location-radio-input" value="YSF_APP"
                                    type="radio" name="payWay" />
                                <span class="checkSt"></span>
                            </label>
                        </li>
                        <li class="aliPayMethod needShow">
                            <label for="ali_pay" data-method="ALIPAY_TRANSFER">
                                <img src="../../image/iconaxglnj.png" alt="" class="labelTImg">
                                <span class="payTitle">支付宝对公转账</span>
                                <input id="ali_pay" class="chat-button-location-radio-input" value="ALIPAY_TRANSFER"
                                    type="radio" name="payWay" />
                                <span class="checkSt"></span>
                            </label>
                        </li>
                        <li class="cardPayMethod needShow">
                            <label for="cardnew_pay" data-method="UNION_APP">
                                <img src="../../image/yinlian.png" alt="" class="labelTImg">
                                <span class="payTitle">银联支付(单笔限两万，单日限五万)</span>
                                <input id="cardnew_pay" class="chat-button-location-radio-input" value="UNION_APP"
                                    type="radio" name="payWay" />
                                <span class="checkSt"></span>
                            </label>
                        </li>
                        <li class="moblieMethod needShow">
                            <label for="moblie_pay" data-method="MB_WAP">
                                <img src="../../image/mobaox.png" alt="" class="labelTImg">
                                <span class="payTitle">Mo宝支付 (1-49999)</span>
                                <input id="moblie_pay" class="chat-button-location-radio-input" value="MB_WAP"
                                    type="radio" name="payWay" />
                                <span class="checkSt"></span>
                            </label>
                        </li>
                        <li class="ipfsPublicPayMethod needShow">
                            <label for="publics_pay" data-method="IPFS_TRANSFER">
                                <img src="../../image/ipfsre.png" alt="" class="labelTImg">
                                <span class="payTitle">专项充值(35万以上IPFS独享矿机)</span>
                                <input id="publics_pay" class="chat-button-location-radio-input" value="IPFS_TRANSFER"
                                    type="radio" name="payWay" />
                                <span class="checkSt" style='float:right'></span>
                            </label>
                        </li>
                    </ul>
                    <div class="otherPay ishide" style="display: none;">
                        <p class="go-page"
                            data-param='{"page":"common/headerwin","name":"focusorin_win","param":{"subpage":"extrapage/focusorin","name":"focusorin","title":"关注微信号充值"}}'>
                            <span>
                                <img src="../../image/codex.png">
                                关注"微矿科技"直接付款下单 (1-40000)
                            </span>
                            <img src="../../image/right_jintou.png">
                        </p>
                    </div>
                </div>
                <p class="payTextTips" style="padding:0.24rem 0.24rem 0 0.24rem;font-size: 0.24rem;color:#8a8a8a">
                    提示：<br>
                    1.只支持储蓄卡充值，现金钱包可用于直接支付算力订单<br>
                    2.购买35万以上IPFS独享矿机，请选择：专项充值（35万以上IPFS独享矿机）
                </p>
                <p class="payTextTipsOTC"
                    style="padding:0.24rem 0.24rem 0 0.24rem;font-size: 0.24rem;color:#8a8a8a;display: none;">
                    提示：1.第三方OTC充值后的数量将放入您的CNY资产余额中<br>
                    2.请您务必准确填写卡主姓名（转账卡主/支付宝认证姓名），以确保充值成功。<br>
                    3.建议充值时间为09:00-21:00
                </p>
                <button class="submit" id="rechargeMoney">立即充值</button>
                <button class="submit" id="otcRechargeCNY" style="display: none;">OTC充值CNY</button>
            </div>
            <div class="pageClass" id="usdtRecharge" style="border-top: 0.2rem solid #f7f7f7;">
                <!-- <div class="lineName">
                    <p>
                        链名称
                    </p>
                    <p class="changeAdress">
                        <span class="checkedSpan" data-value="USDT_OMNI">
                            OMNI
                        </span>
                        <span data-value="USDT_ERC20">
                            ERC20
                        </span>
                    </p>
                </div> -->
                <div
                    style="width: 6.9rem;margin: 0 auto;background-color:#FAFAFA;margin-top: 0.2rem;display: flex;flex-direction: column;align-items: center;margin-bottom: 0.37rem;">
                    <div id="showerweima"
                        style="width:2.17rem;height: 2.13rem;margin-bottom: 0.14rem;margin-top: 0.30rem;">

                    </div>
                    <button class="saveImgPirture"
                        style="width:1.73rem;height:0.5rem;background:rgba(252,213,90,0.11);border:1px solid rgba(252,213,90,1);border-radius:0.04rem;outline: none;color:rgba(233,170,0,1);margin-top: 0.19rem;">
                        保存二维码
                    </button>
                    <p
                        style="color: #181818;padding-top: 0.34rem;font-weight: 500;font-size:0.24rem;font-family:PingFang SC;font-weight:500;color:rgba(153,153,153,1);">
                        充币地址</p>
                    <p class="btcAddress"
                        style="font-size: 0.26rem; color: #181818; font-weight: 500; margin-top: 0.16rem;"
                        id="usdtAddress"></p>
                    <button class="submit sss" data-clipboard-text="" id="copyAddressUsdt"
                        style="width: 6.2rem;margin-top: 0.29rem;margin-bottom: 0.3rem;margin-left: 0;">复制充币地址</button>
                    <button id="hideBUtton" class="submit sss otcAddZfb"
                        data-param='{"page":"common/headerwin","name":"fastbuycoin_headerwin",
                        "param":{"subpage":"mine/fastbuycoin","name":"fastbuycoin","title":"OTC代充","right":"记录","rightParam":{"page":"common/headerwin",
                        "name":"thirdpartylist_headerwin","param":{"subpage":"extrapage/thirdpartylist","name":"thirdpartylist","title":"OTC代充记录"}}}}'
                        style="width: 6.2rem;margin-left: 0;background:rgba(250,250,250,1);border:1px solid #D2D2D2;color: #181818;margin-top: 0;margin-bottom: 0.38rem;font-size: 0.27rem;">
                        OTC代充<span style="color:#898989;font-size: 0.24rem;">(支付宝/银行卡转账)</span>
                    </button>
                </div>
                <!-- <p style="height: 0.86rem;line-height: 0.86rem;color: #616161;font-size: 0.23rem;padding-left: 0.3rem;">
                    实时汇率: <span style="color:#ffd203;">1 USDT = <span class="usdtPrice">0.00</span> BCNY</span>
                </p> -->
                <div class="USDT_OMNI hideBox"
                    style="width: 6.9rem;margin-left:calc((100% - 6.9rem)/2);margin-top: 0rem;padding-bottom: 0.2rem;">
                    <p class="USDTtext" style="line-height: 0.45rem;color:#9e9e9e;line-height: 0.5rem;">
                        温馨提示<br> 1. 请勿向上述地址充值任何非USDT_OMNI资产，否则资产将不可找回。<br>
                        2. USDT充币仅支持simple send的方法，使用其他方法（send all）的充币暂时无法上账，请您谅解。
                        <br> 3. 您充值至上述地址后，需要整个网络节点的确认
                        <br>
                        4.最小充值金额：
                        <span style="color: #F86666;">
                            20 USDT
                        </span>
                        ，小于最小金额的充值将不会上账且无法退回。<br>
                        5.您的充值地址不会经常改变，可以重复充值；如有更改，我们会尽量通过网站公告或邮件通知您
                        <br> 6. 请务必确认设备及浏览器安全，防止信息被篡改或泄露。
                        <br>
                    </p>
                </div>
                <div class="USDT_ERC20 hideBox"
                    style="width: 6.9rem;margin-left:calc((100% - 6.9rem)/2);margin-top: 0rem;padding-bottom: 0.2rem;display: none;">
                    <p class="USDTtext" style="line-height: 0.45rem;color:#9e9e9e;line-height: 0.5rem;">
                        温馨提示<br> 1.请勿向上述地址充值任何非ERC20_USDT资产，否则资产将不可找回。<br>
                        2.您充值至上述地址后，需要整个网络节点的确认，12 次网络确认后到账，12次网络确认后可提币。
                        <br>
                        3.最小充值金额：
                        <span style="color: #F86666;">
                            5 USDT
                        </span>
                        ，小于最小金额的充值将不会上账且无法退回。<br>
                        4.您的充值地址不会经常改变，可以重复充值；如有更改，我们会尽量通过网站公告或邮件通知您。
                        <br> 5.请务必确认设备及浏览器安全，防止信息被篡改或泄露。
                        <br>
                    </p>
                </div>
            </div>
            <div class="pageClass" id="filRecharge" style="border-top: 0.2rem solid #f7f7f7;">
                <div
                    style="width: 6.9rem;margin: 0 auto;background-color:#FAFAFA;margin-top: 0.2rem;display: flex;flex-direction: column;align-items: center;margin-bottom: 0.37rem;">
                    <div id="showerweimanew"
                        style="width:2.17rem;height: 2.13rem;margin-bottom: 0.14rem;margin-top: 0.30rem;">
                    </div>
                    <button class="saveImgPirtureFil"
                        style="width:1.73rem;height:0.5rem;background:rgba(252,213,90,0.11);border:1px solid rgba(252,213,90,1);border-radius:0.04rem;outline: none;color:rgba(233,170,0,1);margin-top: 0.19rem;">
                        保存二维码
                    </button>
                    <p
                        style="color: #181818;padding-top: 0.34rem;font-weight: 500;font-size:0.24rem;font-family:PingFang SC;font-weight:500;color:rgba(153,153,153,1);">
                        充币地址</p>
                    <p class="btcAddress"
                        style="font-size: 0.26rem; color: #181818; font-weight: 500; margin-top: 0.16rem;"
                        id="filCoinAddress"></p>
                    <button class="submit sss" data-clipboard-text="" id="copyAddressFil"
                        style="width: 6.2rem;margin-top: 0.29rem;margin-bottom: 0.3rem;margin-left: 0;">复制充币地址</button>
                </div>
                <div style="width: 6.9rem;margin-left:calc((100% - 6.9rem)/2);margin-top: 0rem;padding-bottom: 0.2rem;">
                    <p class="USDTtext" style="line-height: 0.45rem;color:#9e9e9e;line-height: 0.5rem;">
                        温馨提示<br> 1.请勿向上述地址充值任何非 FIL 资产，否则资产将不可找回。<br>
                        2.您充值至上述地址后，需要整个网络节点的确认，60次网络确认后到账，910次网络确认后可提币。<br> 
                        3.最小充值金额：1 FIL，小于最小金额的充值将不会上账且无法退回。<br>
                        4.您的充值地址不会经常改变，可以重复充值；如有更改，我们会尽量通过网站公告或邮件通知您。<br>
                        5.请务必确认电脑及浏览器安全，防止信息被篡改或泄露。<br>
                        6.通过ID(0类地址)形式的充值将无法上账，请您谅解。<br>
                    </p>
                </div>
            </div>
        </div>
    </div>
    <script src="../../script/autosize.js"></script>
    <script src="../../script/jquery_three_two_one.js"></script>
    <script src="../../script/fastclick.js"></script>
    <script src="../../script/app.js"></script>
    <script src="../../script/html2canvas.js"></script>
    <script src="../../script/htmlto_image.js"></script>
    <script src="../../script/jqueryqrcodemin.js"></script>
    <script src="../../script/iosselect.js"></script>
    <!--    <script src="../../js/littemoney.js"></script>-->
    <script>
        apiready = function () {
            var app = new APP();
            app.headerMap();
            if (app.ST == "ios") {
                $("input").click(function () {
                    $(this).focus().select(); //保险起见，还是加上这句。
                });
            }
            var checkGoMyPage = api.pageParam.checkGoMyPage;
            var account = app.getAccount();
            var payWay = 0; //显示的页面级数。默认是：余额充值页面为0;
            var usdtPrice = 1; //usdt兑换汇率
            var btcAddress = ""; //btc充值地址
            var usdtAddress = ""; //usdt充值地址
            var filCoinAdree = "";//filCoin充币地址
            var usdtAddNum = ''; //usdt充值数量
            var getChoose = "CNY";
            var isOkwxPay = false;
            var isdataArr; //外币支付方式
            var addType = '';
            if (api.pageParam.addType) {
                addType = api.pageParam.addType;
            }
            var allPayChannel = ["WX_AMY", "UNION_APP", "BANK_TRANSFER", "ALIPAY_TRANSFER", "YSF_APP", "CUSTOMER_SERVICE", "MB_WAP", "OTC_USDT", "OTC_CNY", "IPFS_TRANSFER"];
            var canPayChannel = [];
            //筛选出不支持充值方式 比价allPayChannel与ret.pay_channel 取不同的部分说明是不支持
            function getArrDifference(arr1, arr2) {
                return arr1.concat(arr2).filter(function (v, i, arr) {
                    return arr.indexOf(v) === arr.lastIndexOf(v);
                });
            }
            //获取支付权限
            function getPayjurisdiction(account, isShowOtc) {
                app.ajax({
                    param: {
                        method: "post",
                        url: app.ajaxUrl + "recharge/channels",
                        data: { values: { uid: account.uid, token: account.token } },
                        callback: function (ret, err) {
                            // console.log("获取支付渠道" + JSON.stringify(ret));
                            if (ret.code == 200) {
                                $(".showchoose li").removeClass('ishide').addClass('needShow');
                                canPayChannel = ret.data.channels;
                                //单独判断是否支持OTC第三方充值
                                if (canPayChannel.length > 0 && isShowOtc == true) {
                                    var checkIsOtc = canPayChannel.indexOf("OTC_USDT");
                                    var checkISOtcCny = canPayChannel.indexOf("OTC_CNY");
                                    if (checkIsOtc != -1) {
                                        $("#hideBUtton").show();
                                    }
                                    if (checkISOtcCny != -1) {
                                        $("#otcRechargeCNY").show();
                                    }
                                }
                                var prhitePayChannel = getArrDifference(allPayChannel, canPayChannel);
                                function isInArray(arr, value) {
                                    for (var i = 0; i < arr.length; i++) {
                                        if (value === arr[i]) {
                                            return true;
                                        }
                                    }
                                    return false;
                                }
                                $(".showchoose>li").each(function () {
                                    var labelMethod = $(this).find('label').data('method');
                                    if (isInArray(prhitePayChannel, labelMethod)) {
                                        $(this).removeClass('needShow').addClass('ishide');
                                    } else {
                                        $(this).addClass('needShow').removeClass('ishide');
                                    }
                                })
                                $("ul").find('.needShow').eq(0).find('input').click();
                                $(".showchoose .checkSt").unbind('click').click(function () {
                                    $(this).siblings('input').click();
                                })
                                $(".showchoose").show();
                            }
                        }
                    },
                    extra: {
                        isflower: true
                    }
                });
            }
            getPayjurisdiction(account, true);
            var myblance; var rechageInput = 0;
            app.getProperties(account, function (ret) {
                console.log('获取资产+++++++++++++++++++++++' + JSON.stringify(ret));
                if (ret.code == 200) {
                    myblance = Number(ret.data.lists.rmb);
                    $(".myproty").text((myblance == 0 ? "0.00" : app.outputmoney(myblance)) + " " + "CNY");
                    isdataArr = [{ id: "CNY", value: "人民币—CNY" }];
                    var acceptClik = 0;
                    var showBankDom = document.querySelector('#showBank');
                    var bankIdDom = document.querySelector('#bankId');
                    showBankDom.addEventListener('click', function () {
                        var bankId = showBankDom.dataset['id'];
                        $(".showchoose li input").removeAttr('checked');
                        $("#inputReNumber").val("");
                        $(".showchoose").hide();
                        acceptClik++;
                        if (acceptClik > 1) return;
                        var bankSelect = new IosSelect(1,
                            [isdataArr], {
                            title: '',
                            oneLevelId: bankId,
                            itemHeight: 1,
                            headerHeight: 0.88,
                            itemShowCount: 3,
                            maskCallback: function () {
                                acceptClik = 0;
                            },
                            fallback: function () {
                                acceptClik = 0;
                                //暂时默认CNY 现在只有CNY可选择
                                getChoose = "CNY";
                                if (getChoose == "CNY") {
                                    $(".showchoose").hide();
                                    $(".showchoose li").addClass('needShow').removeClass('ishide');
                                    $(".payTextTips").text("提示：只支持储蓄卡充值，现金钱包可用于直接支付算力租金")
                                    $(".myproty").text(
                                        (myblance == 0 ? "0.00" : app.outputmoney(myblance)) + getChoose
                                    );
                                    $("ul .needShow").click();
                                    $(".moneyUnit").text("元");
                                    $(".otherPay").addClass('needShow').removeClass('ishide');
                                    getPayjurisdiction(account, true);
                                    return
                                }
                            },
                            cssUnit: 'rem',
                            callback: function (selectOneObj) {
                                acceptClik = 0;
                                bankIdDom.value = selectOneObj.id;
                                showBankDom.innerHTML = selectOneObj.id;
                                getChoose = selectOneObj.id;
                                if (getChoose == "CNY") {
                                    $(".showchoose").hide();
                                    $(".showchoose li").addClass('needShow').removeClass('ishide');
                                    $(".payTextTips").text("提示：只支持储蓄卡充值，现金钱包可用于直接支付算力租金")
                                    $(".myproty").text(
                                        (myblance == 0 ? "0.00" : app.outputmoney(myblance)) + getChoose
                                    );
                                    $("ul .needShow").click();
                                    $(".moneyUnit").text("元");
                                    $(".otherPay").addClass('needShow').removeClass('ishide');
                                    getPayjurisdiction(account, true);
                                    return
                                }
                            }
                        }
                        );

                    });
                }
            });
            var getChoosenew = "", methodnew = "", moneynew = "", pageDatanew = "";
            function openCharge(is_new) {
                var bandData = {
                    name: "publictransfer",
                    subpage: "mine/publictransfer",
                    title: "汇款订单",
                    allowEdit: true,
                    param: {
                        pageName: "publictransfer",
                        allowEdit: true,
                        data: {
                            getChoose: getChoosenew, //cny,
                            chooseMethod: methodnew,  //支付方式
                            money: moneynew, //金额,
                            pageData: pageDatanew,
                            isNew: is_new//是否发起新充值
                        },
                    },
                };
                app.setNavBarAttr(bandData);
            }
            /*---------------------------------------------------*/
            //支付宝五分钟以内阻止二次提交
            function loadPage(method, amount) {
                app.ajax({
                    param: {
                        method: "get",
                        url: app.ajaxUrl + "recharge/transfer",
                        data: {
                            values: {
                                token: account.token,
                                amount: amount,
                                channel: method
                            }
                        }, callback: function (ret, err) {
                            if (ret.code == 680 || ret.code == 200 || ret.code == 681) {
                                getChoosenew = getChoose, methodnew = method;
                                if (ret.code == 680) {
                                    methodnew = ret.data.data.channel || method;
                                }
                                if (ret.code != 681) {
                                    moneynew = ret.data.data.total_fee;
                                    pageDatanew = ret.data.data;
                                }
                            }
                            if (ret.code == 200) {
                                openCharge(0);
                            } else {
                                if (ret.code == 680) {
                                    var param = {
                                        dtype: "dialog98",
                                        data: {
                                            dataEvent: "dalogClase"
                                        }
                                    };
                                    app.dialog(param);
                                    return
                                }
                                if (ret.code == 681) {
                                    var param = {
                                        dtype: "dialog97",
                                        data: {
                                            dataEvent: "dalogClasenew",
                                            cancalEvent: "closedailog"
                                        }
                                    };
                                    app.dialog(param);
                                    return
                                }
                                app.toast(ret.message);
                            }
                        }
                    },
                    extra: {
                        isflower: true
                    }
                });
            }
            app.listen("dalogClase", function (params) {
                openCharge(0);
            })
            app.listen("dalogClasenew", function () {
                app.ajax({
                    param: {
                        method: "get",
                        url: app.ajaxUrl + "recharge/transfer",
                        data: {
                            values: {
                                token: account.token,
                                amount: rechageInput,
                                channel: chooseMethod,
                                is_new: 1
                            }
                        }, callback: function (ret, err) {
                            if (ret.code == 200) {
                                moneynew = ret.data.data.total_fee;
                                pageDatanew = ret.data.data;
                                openCharge(1);
                            } else {
                                app.toast(ret.message);
                            }
                        }
                    }
                })
            })
            var chooseMethod = 'WX_APP';
            $("#rechargeMoney").click(function () {
                chooseMethod = $(".showchoose input[name=payWay]:checked").val();
                rechageInput = $("#inputReNumber").val();
                var payMethodShort = chooseMethod.split("_")[0];
                if (!rechageInput) {
                    app.toast("请输入充值金额");
                    return
                };
                if (chooseMethod == "OTC_CNY" && !$("#cardCnyUserName").val()) {
                    app.toast("请输入转账卡主/支付宝认证姓名");
                    return
                }
                if (chooseMethod == "YSF_APP" && rechageInput > 5000) {
                    app.toast("超过支付单次限额，建议使用对公转账");
                    $(".publicPayMethod input").prop("checked", true);
                    return
                }
                if (chooseMethod == "UNION_APP" && rechageInput > 20000) {
                    app.toast("银联支付单笔限两万");
                    rechageInput = 20000;
                    $("#inputReNumber").val(rechageInput);
                }
                if (chooseMethod == "WX_APP" || chooseMethod == "ALI_APP") {
                    //微信，支付宝
                    app.ajax({
                        param: {
                            method: "post",
                            url: app.ajaxUrl + "deposit/newRecharge",
                            data: {
                                values: {
                                    token: account.token,
                                    channel: chooseMethod,
                                    amount: rechageInput
                                }
                            },
                            callback: function (ret, err) {
                                app.log("littlemoneyrecharge", "充值返回：" + JSON.stringify(ret));
                                if (ret.code == 1) {
                                    if (chooseMethod == "YSF_APP") {
                                        var unPay = api.require("unionPay");
                                        unPay.pay({
                                            tn: ret.appPayRequest.tn,
                                            devMode: false
                                        }, function (ret, err) {
                                            if (ret.result == "success") {
                                                app.reload();
                                                app.toast("支付成功");
                                            }
                                            if (ret.result == "fail") {
                                                app.toast("支付失败");
                                            }
                                            if (ret.result == "cancel") {
                                                app.toast("取消支付");
                                            }
                                        });
                                    } else {
                                        // 跳转到第三方支付
                                        app.pay(payMethodShort, ret.appPayRequest, function (ret, err) {
                                            if (payMethodShort == "WX" && ret.status || payMethodShort == "ALI" && ret.code == "9000") {
                                                app.trigger("littlemoney_recharge_success");
                                                app.tout(100, function () {
                                                    app.closeW();
                                                });
                                            }
                                        });
                                    }
                                } else {
                                    app.toast(ret.message);
                                }
                            }
                        },
                        extra: {
                            isflower: true
                        }
                    });
                } else if (chooseMethod == "OTC_CNY") {
                    // 获取OTC充值地址
                    app.ajax({
                        param: {
                            method: "post",
                            url: app.ajaxUrl + "otc/pay",
                            data: {
                                values: {
                                    token: account.token,
                                    amount: rechageInput,
                                    username: $("#cardCnyUserName").val(),
                                    pay_channel: "OTC_CNY"
                                }
                            },
                            callback: function (ret, err) {
                                if (ret.code == 200) {
                                    var goCerfition = {
                                        name: "browser",
                                        subpage: "common/browser",
                                        title: "在线支付",
                                        param: {
                                            pageName: "browser",
                                            url: ret.data,
                                            isThreePay: true
                                        }
                                    }
                                    app.setNavBarAttr(goCerfition);
                                } else {
                                    app.toast(ret.message);
                                }
                            }
                        },
                        extra: {
                            isflower: true
                        }
                    });
                } else if (chooseMethod == "UNION_APP") {
                    //新银联支付
                    app.ajax({
                        param: {
                            method: "post",
                            url: app.ajaxUrl + "deposit/union-pay",
                            data: {
                                values: {
                                    token: account.token,
                                    channel: chooseMethod,
                                    amount: rechageInput
                                }
                            },
                            callback: function (ret, err) {
                                if (ret.code == 200) {
                                    var unPay = api.require("unionPay");
                                    unPay.pay({
                                        tn: ret.data.appPayRequest.tn,
                                        devMode: false
                                    }, function (ret, err) {
                                        if (ret.result == "success") {
                                            app.reload();
                                            app.toast("支付成功");
                                        }
                                        if (ret.result == "fail") {
                                            app.toast("支付失败");
                                        }
                                        if (ret.result == "cancel") {
                                            app.toast("取消支付");
                                        }
                                    });
                                } else {
                                    app.toast(ret.message);
                                }
                            }
                        },
                        extra: {
                            isflower: true
                        }
                    });
                } else {
                    if (chooseMethod == "BANK_TRANSFER" || chooseMethod == "ALIPAY_TRANSFER" || chooseMethod == "C2C_TRANSFER" || chooseMethod == "IPFS_TRANSFER") {
                        loadPage(chooseMethod, rechageInput);
                    } else if (chooseMethod == "YSF_APP") {
                        //老银联
                        app.ajax({
                            param: {
                                method: "post",
                                url: app.ajaxUrl + "deposit/ums-pay",
                                data: {
                                    values: {
                                        token: account.token,
                                        channel: chooseMethod, amount: rechageInput
                                    }
                                },
                                callback: function (ret) {
                                    var unPay = api.require("unionPay");
                                    unPay.pay({
                                        tn: ret.data.appPayRequest.tn,
                                        devMode: false
                                    }, function (ret, err) {
                                        if (ret.result == "success") {
                                            app.reload();
                                            app.toast("支付成功");
                                        }
                                        if (ret.result == "fail") {
                                            app.toast("支付失败");
                                        }
                                        if (ret.result == "cancel") {
                                            app.toast("取消支付");
                                        }
                                    });
                                }
                            }
                        });
                    }
                }
            });
            $(".otcAddZfb").unbind('click').click(function () {
                var param = {
                    "page": "common/headerwin", "name": "fastbuycoin_headerwin",
                    "param": { "subpage": "mine/fastbuycoin", "name": "fastbuycoin", "title": "OTC代充", "right": "记录", "rightParam": { "page": "common/headerwin", "name": "thirdpartylist_headerwin", "param": { "subpage": "extrapage/thirdpartylist", "name": "thirdpartylist", "title": "OTC代充记录" } } }
                };
                var recoinNumber = JSON.stringify(param);
                app.goPushPage(recoinNumber);
            });
            /*----------------------usdt   input变化-----------------------------*/
            $("#transferred").bind("input porpertychange", function () {
                usdtAddNum = $(this).val();
                $(".aboutCanAdd").text(app.accMul(Number(usdtAddNum), Number(usdtPrice)));
            });
            /*------------------------usdt 点击充值---------------------------*/
            $("#addUsdt").bind('tap click', function () {
                var transferredNumber = $("#transferred").val();
                var getUserName = $("#cardUserName").val();
                if (!transferredNumber) {
                    app.toast("请输入充值金额");
                    return
                }
            });
            /*-------------------------复制充币地址--------------------------*/
            $("#copyAddress").click(function () {
                if (app.clipboard) {
                    var text = $("#copyAddress").data("clipboard-text");
                    if (text) {
                        app.clipboard.set({
                            value: text
                        }, function (ret, err) {
                            if (ret.status) {
                                app.toast("复制成功");
                            } else {
                                app.toast("复制失败");
                            }
                        });
                    } else {
                        app.toast("复制不能为空");
                    }
                }
            });
            $("#otcRechargeCNY").on("click", function () {
                var cointypecontract = {
                    page: "common/headerwin",
                    name: "fastbuycny_headerwin",
                    param: {
                        subpage: "mine/fastbuycny",
                        name: "fastbuycny",
                        title: "OTC代充CNY",
                        cnynumber: $("#inputReNumber").val(),
                        right: "记录",
                        rightParam: {
                            page: "common/headerwin",
                            name: "thirdpartycnylist_headerwin",
                            param: {
                                subpage: "mine/thirdpartycnylist",
                                name: "thirdpartycnylist",
                                title: "OTC代充CNY记录"
                            }
                        }
                    }
                }
                var recoinNumber = JSON.stringify(cointypecontract);
                app.goPushPage(recoinNumber);
            })
            function getUsdtAdress(account, type) {
                $("#showerweima").empty();
                $("#usdtAddress").text("");
                $("#copyAddressUsdt").attr('data-clipboard-text', "");
                app.ajax({
                    param: {
                        method: "post",
                        url: app.ajaxUrl + "member/get-charge-address",
                        data: {
                            values: {
                                token: account.token,
                                addressType: type
                            }
                        },
                        callback: function (ret, err) {
                            console.log("*--------ret" + JSON.stringify(ret) + "err" + JSON.stringify(err));
                            //usdt地址
                            if (ret.code == 200 && ret.data.address) {
                                usdtAddress = ret.data.address;
                                $("#usdtAddress").text(usdtAddress);
                                $("#copyAddressUsdt").attr('data-clipboard-text', usdtAddress);
                                $("#showerweima").qrcode({
                                    render: "canvas", //也可以替换为table
                                    width: app.W * 0.3,
                                    height: app.W * 0.3,
                                    text: ret.data.address
                                });
                            }
                        }
                    },
                    extra: {
                        isflower: true
                    }
                });
            }
            function getFilCoinAdress(account, type) {
                $("#showerweimanew").empty();
                $("#filCoinAddress").text("");
                $("#copyAddressFil").attr('data-clipboard-text', "");
                app.ajax({
                    param: {
                        method: "post",
                        url: app.ajaxUrl + "member/get-charge-address",
                        data: {
                            values: {
                                token: account.token,
                                addressType: "FIL"
                            }
                        }, callback: function (ret, err) {
                            // console.log("*--------ret" + JSON.stringify(ret) + "err" + JSON.stringify(err));
                            //FIL地址
                            if (ret.code == 200 && ret.data.address) {
                                filCoinAdree = ret.data.address;
                                $("#filCoinAddress").text(filCoinAdree);
                                $("#copyAddressFil").attr('data-clipboard-text', filCoinAdree);
                                $("#showerweimanew").qrcode({
                                    render: "canvas", //也可以替换为table
                                    width: app.W * 0.3,
                                    height: app.W * 0.3,
                                    text: ret.data.address
                                });
                            } else {
                                app.toast(ret.message);
                            }
                        }
                    },extra: {
                        isflower: true
                    }
                });
            }
            /*----------------------点击头部选择------------------------*/
            $(".payWays>li").bind('tap click', function () {
                if (!$(this).hasClass('isSelected')) {
                    $(".payWays>li").removeClass('isSelected');
                    $(this).addClass('isSelected');
                    payWay = $(this).index();
                    $(".outBox>.pageClass").fadeOut(20);
                    $(".outBox>.pageClass").eq(payWay).fadeIn(30);
                    if ($(this).index() != 0) {
                        $(".olay").hide();
                        acceptClik = 0;
                    };
                    if ($(this).attr("data-type") == "addressBtc") {
                        app.ajax({
                            param: {
                                method: "post",
                                url: app.ajaxUrl + "wallet/userRechargeCoinAddress",
                                data: {
                                    values: {
                                        token: account.token,
                                        currency_name: 'BTC'
                                    }
                                },
                                callback: function (ret, err) {
                                    if (ret.code == 200 && ret.address != null) {
                                        btcAddress = ret.address.wallet_address;
                                        $("#btcAddress").text(btcAddress);
                                        $("#copyAddress").attr('data-clipboard-text', btcAddress);
                                    }
                                }
                            },
                            extra: {
                                isflower: true
                            }
                        });
                        return
                    }
                    if ($(this).attr("data-type") == "addressUsdt") {
                        $(".changeAdress span:first-of-type").addClass("checkedSpan").siblings().removeClass("checkedSpan");
                        getUsdtAdress(account, "USDT_OMNI");
                        return
                    }
                    if ($(this).attr("data-type") == "addressFil") {
                        $(".changeAdress span:first-of-type").addClass("checkedSpan").siblings().removeClass("checkedSpan");
                        getFilCoinAdress(account, "USDT_OMNI");
                    }
                }
            });
            $(".changeAdress span").click(function (params) {
                $(this).addClass("checkedSpan").siblings().removeClass("checkedSpan");
                var thisValue = $(this).attr("data-value");
                $(".hideBox").hide();
                $("." + thisValue).show();
                getUsdtAdress(account, thisValue);
            })
            $(".saveImgPirture").click(function () {
                var textnew = $("#copyAddressUsdt").attr("data-clipboard-text");
                if (!textnew) return
                app.getPicJurisdiction(function (ret) {
                    var opts = {
                        scale: 2, // 添加的scale 参数 //ios默认
                        width: app.W * 0.3,
                        height: app.W * 0.3,
                        logging: true, //日志开关，便于查看html2canvas的内部执行流程
                        useCORS: true // 【重要】开启跨域配置
                    };
                    html2canvas(document.getElementById("showerweima"), opts).then(function (canvas) {
                        var base64 = canvas.toDataURL("image/png", 0.6);
                        var imgName = "renrennew" + new Date().getTime() + ".png";
                        var trans = api.require("trans");
                        trans.saveImage({
                            base64Str: base64.split(";base64,")[1],
                            imgPath: "fs://shareImg/",
                            imgName: imgName,
                            album: true
                        }, function (ret, err) {
                            app.log("canvas ret ", ret);
                            if (ret.status) {
                                app.toast("保存成功");
                            } else {
                                app.toast("生成图片失败");
                            }
                        });
                    })
                    return
                    htmltoImage.init({
                        'el': document.getElementById("showerweimaNew"),
                        'isImageObject': true,
                    }, function (res, err) {
                        if (res) {
                            var base64Str1 = htmltoImage.cutprefixBase64(res.base64str);
                            var imgName = "renren" + new Date().getTime() + ".png";
                            var trans = api.require("trans");
                            trans.saveImage({
                                base64Str: base64Str1,
                                imgPath: "fs://posterimg/",
                                imgName: imgName,
                                album: true
                            }, function (ret, err) {
                                if (ret.status) {
                                    app.toast("保存成功");
                                } else {
                                    app.toast("生成图片失败");
                                }
                            });
                        } else {
                            app.toast("转换失败");
                        }
                    })
                })
            })
            $("#copyAddressUsdt").click(function () {
                if (app.clipboard) {
                    var text = $("#copyAddressUsdt").attr("data-clipboard-text");
                    if (text) {
                        app.clipboard.set({
                            value: text
                        }, function (ret, err) {
                            app.log("copy", ret);
                            if (ret.status) {
                                app.toast("复制成功");
                            } else {
                                app.toast("复制失败");
                            }
                        });
                    } else {
                        app.toast("复制不能为空");
                    }
                }
            });
            //filcoin 保存二维码图片
            $(".saveImgPirtureFil").click(function () {
                var textnew = $("#copyAddressFil").attr("data-clipboard-text");
                if (!textnew) return
                app.getPicJurisdiction(function (ret) {
                    var opts = {
                        scale: 2, // 添加的scale 参数 //ios默认
                        width: app.W * 0.3,
                        height: app.W * 0.3,
                        logging: true, //日志开关，便于查看html2canvas的内部执行流程
                        useCORS: true // 【重要】开启跨域配置
                    };
                    html2canvas(document.getElementById("showerweimanew"), opts).then(function (canvas) {
                        var base64 = canvas.toDataURL("image/png", 0.6);
                        var imgName = "renrennew" + new Date().getTime() + ".png";
                        var trans = api.require("trans");
                        trans.saveImage({
                            base64Str: base64.split(";base64,")[1],
                            imgPath: "fs://shareImg/",
                            imgName: imgName,
                            album: true
                        }, function (ret, err) {
                            app.log("canvas ret ", ret);
                            if (ret.status) {
                                app.toast("保存成功");
                            } else {
                                app.toast("生成图片失败");
                            }
                        });
                    })
                })
            })
            //复制FIL地址
            $("#copyAddressFil").click(function () {
                if (app.clipboard) {
                    var text = $("#copyAddressFil").attr("data-clipboard-text");
                    if (text) {
                        app.clipboard.set({
                            value: text
                        }, function (ret, err) {
                            app.log("copy", ret);
                            if (ret.status) {
                                app.toast("复制成功");
                            } else {
                                app.toast("复制失败");
                            }
                        });
                    } else {
                        app.toast("复制不能为空");
                    }
                }
            });
            $("input[name=payWay]").change(function () {
                chooseMethod = $(this).val();
                if (chooseMethod == "OTC_CNY") {
                    $(".showOtcInput,.payTextTipsOTC").show();
                    $(".payTextTips").hide();
                } else {
                    $(".showOtcInput,.payTextTipsOTC").hide();
                    $(".payTextTips").show();
                }
            });
            $("#inputReNumber").bind('input porpertychange change keyup', function () {
                var thisVal = Number($(this).val());
                if (canPayChannel.indexOf('MB_WAP') != -1 && getChoose == 'CNY') {
                    if (thisVal >= 50000) {
                        $(".moblieMethod").removeClass('needShow').addClass('ishide');
                        if (chooseMethod == "MB_WAP")
                            $("ul>.needShow").eq(0).find('input').click();
                    } else {
                        $(".moblieMethod").removeClass('ishide').addClass('needShow');
                    }
                }
            });
        };
    </script>
</body>

</html>